package com.xdtech.trans.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.trans.model.TransAccountTrade;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-06-07 14:39:35
 * @since 1.0
 * @see
 */
public class TransAccountTradeItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="网点名称",width=100)
	private String websiteName;
	@GridColumn(title="交易号",width=120)
	private String tradeNo;
	@GridColumn(title="交易单号",width=120)
	private String tradeOrderNo;
	@GridColumn(title="交易日期",width=120)
	private String tradeDate;
	@GridColumn(title="交易类型",width=100,dictionaryCode="TRADE_TYPE")
	private String tradeType;
	@GridColumn(title="交易金额",width=100)
	private Double tradeBalance;
	@GridColumn(title="是否现金交易",width=100,dictionaryCode="YON")
	private String isCash;
	@GridColumn(title="经办人",width=100)
	private String operator;
	@GridColumn(title="备注",width=150)
	private String remark;
	
	private Double afterOperateBalance;
	
	private Long accountId;
	
	private Long websiteId;
	
	private String tradeDateFrom;
	
	private String tradeDateEnd;
	

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
		addQuerys("tradeNo", tradeNo);
	}
	public String getTradeNo() {
		return tradeNo;
	}
	
	public void setTradeDate(String tradeDate) {
		this.tradeDate = tradeDate;
		addQuerys("tradeDate", tradeDate);
	}
	public String getTradeDate() {
		return tradeDate;
	}
	
	public void setTradeType(String tradeType) {
		this.tradeType = tradeType;
		addQuerys("tradeType", tradeType);
	}
	public String getTradeType() {
		return tradeType;
	}
	
	public void setTradeBalance(Double tradeBalance) {
		this.tradeBalance = tradeBalance;
		addQuerys("tradeBalance", tradeBalance);
	}
	public Double getTradeBalance() {
		return tradeBalance;
	}
	
	public void setOperator(String operator) {
		this.operator = operator;
		addQuerys("operator", operator);
	}
	public String getOperator() {
		return operator;
	}
	
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Double getAfterOperateBalance() {
		return afterOperateBalance;
	}
	public void setAfterOperateBalance(Double afterOperateBalance) {
		this.afterOperateBalance = afterOperateBalance;
	}
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
		addQuerys("accountId", accountId);
	}
	public Long getWebsiteId() {
		return websiteId;
	}
	public void setWebsiteId(Long websiteId) {
		this.websiteId = websiteId;
		addQuerys("websiteId", websiteId);
	}
	public String getWebsiteName() {
		return websiteName;
	}
	public void setWebsiteName(String websiteName) {
		this.websiteName = websiteName;
		addQuerys("websiteName", websiteName);
	}
	public String getTradeDateFrom() {
		return tradeDateFrom;
	}
	public void setTradeDateFrom(String tradeDateFrom) {
		this.tradeDateFrom = tradeDateFrom;
		addQuerys("tradeDateFrom", tradeDateFrom);
	}
	public String getTradeDateEnd() {
		return tradeDateEnd;
	}
	public void setTradeDateEnd(String tradeDateEnd) {
		this.tradeDateEnd = tradeDateEnd;
		addQuerys("tradeDateEnd", tradeDateEnd);
	}
	public String getTradeOrderNo()
	{
		return tradeOrderNo;
	}
	public void setTradeOrderNo(String tradeOrderNo)
	{
		this.tradeOrderNo = tradeOrderNo;
		addQuerys("tradeOrderNo", tradeOrderNo);
	}
	
	public String getIsCash() {
		return isCash;
	}
	public void setIsCash(String isCash) {
		this.isCash = isCash;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TransAccountTradeItem createItem(TransAccountTrade transAccountTrade) {
		TransAccountTradeItem transAccountTradeItem = new TransAccountTradeItem();
		BeanUtils.copyProperties(transAccountTradeItem, transAccountTrade);
		//自定义属性设置填充
		return transAccountTradeItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TransAccountTradeItem> createItems(List<TransAccountTrade> transAccountTrades) {
		List<TransAccountTradeItem> transAccountTradeItems = new ArrayList<TransAccountTradeItem>();
		for (TransAccountTrade transAccountTrade : transAccountTrades) {
			transAccountTradeItems.add(createItem(transAccountTrade));
		}
		return transAccountTradeItems;
	}
}
